package com.fjw.service.impl;

import com.fjw.mapper.UserMapper;
import com.fjw.pojo.User;
import com.fjw.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public void regist(User user){
        userMapper.regist(user);
    }

    @Override
    public User findByUsername(String username) {
        return userMapper.findByUsername(username);
    }

    @Override
    public void updateById(User user) {
        System.out.println(user);
        userMapper.updateById(user);
    }

    @Override
    public void updatePassword(Integer id, String password) {
        userMapper.updatePassword(id,password);
    }
}
